package com.blb.mapper;

import com.blb.entity.Brand;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author txy
 * @since 2019-07-10
 */
public interface BrandMapper extends BaseMapper<Brand> {

    //根据类别id获取品牌信息
    @Select("SELECT * FROM t_brand WHERE id IN (SELECT brand_id FROM t_brand_type WHERE type_id IN (${ids}))")
    List<Brand> getBrandByComtypeIds(@Param("ids") String ids);
}
